package com.csc.finalproject.dao;

import java.util.List;
import java.util.Map;


/**
 * interface of generic dao
 * @author Phuc
 * create date : 19/8/2014
 */
public interface GenericDAO<T> {

	/**
	 *  function number row of table in database
	 * @param params
	 * @return number row in table
	 */
	long countAll(final Map<String, Object> params);
	
	
	
	/**
	 * fuction get all row of table in database
	 * @return all row in table
	 */
	List<T> getAll();
	
	/**
	 * create object type T and return
	 * @param t
	 * @return object <T>
	 */
	T create(T t);
	
	
	/**
	 * delete object from database
	 * @param id
	 * 
	 */
	void delete(Object id);
	
	/**
	 * find object from database with param id
	 * @param id
	 * @return object<T>
	 */
	T find(Object id);
	
	
	/**
	 * update object to database and return object
	 * @param t
	 * @return object after update
	 */
	T update(T t) ;
	
}
